package birs.controller.expanditure;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import birs.controller.expanditure.task.XPD004Task;

/**
 * Servlet implementation class XPD004Controller
 */
@WebServlet("/XPD004Controller")
public class XPD004Controller extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public XPD004Controller() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		XPD004Task xpd004Task = new XPD004Task();
		if(request.getParameter("p").equalsIgnoreCase("initial")){
			xpd004Task.getExpenditureQuarterTree(request, response);
		}else{
			if(!request.getParameter("projectId").equals("undefined")){
				xpd004Task.getDrilldownByProject(request, response);
			}else if(!request.getParameter("departmentId").equals("undefined")){
				xpd004Task.getDrilldownByDepartment(request, response);
			}else if(!request.getParameter("budgetPeriodId").equals("undefined") && !request.getParameter("budgetGroupId").equals("undefined")){
				xpd004Task.getDrilldownByBudgetGroup(request, response);
			}else if(!request.getParameter("budgetPeriodId").equals("undefined")){
				xpd004Task.getDrilldownByPeriodYear(request, response);
			}
		}
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
